
//判断本地存储中是否有userInfo字段中，如果有就return true 没有就return fase
import { useState } from "react";
export default function (initialState:object) {
    let [userInfo,setInfo] = useState(initialState)

    let isLogin = JSON.parse(localStorage.getItem("userInfo") || '{}')

    function setUserInfo(newState:object){
        setInfo(newState)
    }


    return [isLogin,setUserInfo]
}